package com.hzh.cusviewdemo.Activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

import com.hzh.cusviewdemo.Base.BaseActivity;
import com.hzh.cusviewdemo.R;
import com.hzh.cusviewdemo.Util.Config;

public class AnimActivity extends BaseActivity {

    private TextView aa_txt;

    @Override
    public int getLayout() {
        return R.layout.activity_anim;
    }

    @Override
    public void initView() {
        aa_txt = findViewById(R.id.aa_txt);

        Animation animation = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.anim_view);
        aa_txt.startAnimation(animation);

        animation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
                Log.e(Config.TAG, "onAnimationStart~");
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                Log.e(Config.TAG, "onAnimationEnd~");
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
                Log.e(Config.TAG, "onAnimationRepeat~");
            }
        });
    }

    @Override
    public void initData() {

    }
}